/*
 * @Author: Simon 1958058172@qq.com
 * @Date: 2025-08-04 18:57:30
 * @LastEditors: Simon 1958058172@qq.com
 * @LastEditTime: 2025-08-05 15:11:55
 * @FilePath: \java.1212\day03\work02\Test.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day03.work02;

public class Test {
    public static void main(String[] args) {
        AreEqual a=new AreEqual();
        // 测试基本数据类型(通过包装类)
        System.out.println(a.isEqual(10, 10));                  // true
        System.out.println(a.isEqual(10, 20));                  // false
        System.out.println(a.isEqual(3.14, 3.14));              // true
        System.out.println(a.isEqual(true, false));              // false

        System.out.println("---------------------------");
        
        // 测试字符串
        System.out.println(a.isEqual("hello", "hello"));        // true
        System.out.println(a.isEqual(new String("hi"), "hi"));  // true

        System.out.println("-----------------------------");
        
        // 测试自定义引用类型
        Person p1 = new Person("Alice", 25);
        Person p2 = new Person("Alice", 25);
        Person p3 = new Person("Bob", 30);
        
        System.out.println(a.isEqual(p1, p2));                  // true 
        System.out.println(a.isEqual(p1, p3));                  // false
        
        System.out.println("--------------------------------------");

        // 测试不同类型
        System.out.println(a.isEqual(10, "10"));                // false
    }
}
    

